<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.util.*"%>

<%
/*
课程添加后台
*/
DBO db=new DBO();//初始数据库链接
request.setCharacterEncoding("utf-8");//设置字符集
ResultSet rs=null;//声明结果集
	String keyid =(String)request.getParameter("keyid");
String kc=(String)request.getParameter("kc");//变量:课程
String js=(String)request.getParameter("js");//变量:介绍
String xf=(String)request.getParameter("xf");//变量:学分

String sql="";//声明sql
 sql="insert into kecheng(kc,js,xf) values('"+kc+"','"+js+"','"+xf+"')";
;//课程SQL 语句
int row=1;///定义执行结果
		
try{

	
		//int row =0;
		row=db.update(sql);
}catch(Exception e){
System.out.println(e.toString());}
if(row==1){
out.println("<script>");
out.println("alert('操作成功');");
out.println("window.location='kechengadd.jsp'");
out.println("</script>");
}else{
out.println("<script>");
out.println("alert('操作失败');");
out.println("window.location='kechengadd.jsp'");
out.println("</script>");
}
db.close();
%>

